@extends('admin.layout')

@section('content')
    <div class="console-content">
        <div class="page-header">
            <h2 id="nav">
                级别列表
                <div class="pull-right">
                    <button onclick="location.href='{{admin_url('agent/create')}}'" class="btn btn-success" data-toggle="tooltip" data-placement="top" data-original-title="新增用户">新增级别</button>
                </div>
            </h2>
        </div>
        <div class="well bs-component">
            <table class="table table-wechat">
                <thead class="thead">
                <tr>
                    <td>级别名</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody class="tbody">
                @if($levels->count())
                    @foreach($levels as $level)
                        <tr>
                            <td>{{ $level->name }}</td>
                            <td>
                                <a href="{{ admin_url('agent/update/'.$level->id) }}" class="btn btn-default btn-xs">编辑</a>
                                <a href="{{ admin_url('agent/destroy/'.$level->id) }}" class="btn btn-danger btn-xs" onclick="return confirm('删除后无法恢复,确定要删除吗')">删除</a>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td colspan="5">
                        <span class="empty_tips">
                            暂无级别，点击
                            <a href="{{ admin_url('agent/create') }}" >添加级别</a>
                        </span>
                        </td>
                    </tr>
                @endif
                </tbody>
            </table>
        </div>
    </div>
@stop

@section('js')
    <script>

    </script>
@stop